#ifndef _MESSAGEPACKET_H
#define _MESSAGEPACKET_H

#include <QDataStream>
#include "packet.h"

class MessagePacket : public Packet {
  protected:
    //Returns Packet type identifier.
    int getPacketId();

    //Returns size of the Package body in bytes.
    int getBodySize();

    void setFromBuffer(QByteArray *buffer);

  public:
    MessagePacket();
    ~MessagePacket();
    //Encodes the information of the packet in a QByteArray of getBodySize() bytes.
    QByteArray getBody();

    void setNick(QString *nick);
    void setMessage(QString *msg);

    QString getNick();
    QString getMessage();

  private:
    //Message sender's nick
    QString * sendersNick;

    //Message being sent.
    QString * message;

};
#endif
